package vm.machine;

public class EqualInstuction extends AbstractInstruction{

     Register reg;
     int value;
    EqualInstuction(Machine machine,String register, int value){
        super((machine));
        reg = machine.getRegister(register);
        this.value = value;
    }
    @Override
    public void doAction() {
        if(reg.getValue() == value){
            machine.getRegister("flag").setValue(1);
        }
    }

    @Override
    public String toString() {
        return "执行Equal指令";
    }
}
